﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using simpleHotel.Client.HotelReference;

namespace simpleHotel.Client.UserControls
{
    public partial class ucUserList : BaseUserControl
    {
        public const string Active = "Đang dùng";
        public const string InActive = "Tạm dừng";
        public const string RoleHotel = "Hotel";
        public const string RoleAdmin = "Admin";
        
        public ucUserList()
        {
            InitializeComponent();
            
        }

        private void btnNew_Click(object sender, EventArgs e)
        {
            var form = new FormUserDetail();
            form.ShowDialog();
        }

        private void btnUpdate_Click(object sender, EventArgs e)
        {
            var form = new FormUserDetail();
            form.ShowDialog();
        }

        private void ucUserList_Load(object sender, EventArgs e)
        {
            var service = new HotelService();
            var table = service.GetAllUsers();

            //this.gridView1.CustomRowCellEditForEditing

            this.gridControl1.DataSource = table;

            //init combobox
            this.repStatus.Items.Add(Active);
            this.repStatus.Items.Add(InActive);
            this.repRole.Items.Add(RoleHotel);
            this.repRole.Items.Add(RoleAdmin);
            //


        }
    }
}
